export default {
  state: {
    tableData: [
      {
        id: 1,
        date: '2016-05-03',
        name: '王小美',
        address: '璃月港玉京台月海亭',
        checked: true
      },
      {
        id: 2,
        date: '2016-05-03',
        name: '天权凝光',
        address: '璃月港玉京台群玉阁',
        checked: false
      },
      {
        id: 3,
        date: '2016-05-03',
        name: '钟离',
        address: '璃月港往生堂客卿',
        checked: false
      },
      {
        id: 4,
        date: '2016-05-03',
        name: '刻晴',
        address: '璃月港璃月七星之玉衡',
        checked: false
      },
      {
        id: 5,
        date: '2016-05-03',
        name: '烟菲',
        address: '璃月港律法掌控着',
        checked: false
      }
    ]
  },
  mutations: {
    add_name (state, payload) {
      // state就是store下的state状态
      state.tableData.push(payload)
    }
  },
  actions: {
    add_name_async ({ commit }, payload) {
      setTimeout(() => {
        commit('add_name', payload)
      }, 2000)
    }
  }
}
